1. Field of the Invention
The present invention relates generally to improving the efficiency of a pipelined processor by eliminating bubbles in the pipeline caused by the execution of jump instructions and more particularly relates to reducing the execution time spent dispatching to code emulation routines using jump instructions with target addresses that are not easily predictable.
2. Description of the Related Art
Threaded code interpreters, such as the Java virtual machine, execute code emulation routines to emulate byte codes in a program. The threaded code interpreter uses jump instructions with computed target addresses to dispatch control between code emulation routines.
Jump instructions with computed targets are a time consuming operation on high performance deeply pipelined processors.
A computed jump instruction executes in the EU 56 where the target instruction of the jump is calculated. In a deeply pipelined processor a jump with a computed target address will typically take &gt;&gt;N cycles to execute where N is the number of pipeline stages to execute. When program flow is redirected by a jump instruction N instructions in the pipeline are now invalid and thus form bubbles, i.e., stages having instructions which will not be executed, in the pipeline. If each pipeline stage executes in one clock cycle, there will be a delay of N clock cycles between the execution of the jump instruction and jump target instruction.
In threaded code interpreters, such as the Java JVM, each emulation routine is about N assembly language instructions. Thus, the delay due to bubbles in the pipeline is about equal to the time required to execute each emulation routine. Ironically, processors utilizing faster clocks utilize deeper pipelines so the performance penalty increases.
Because of the importance of Java and other threaded interpreters improved processor design is important to facilitate high speed execution of programs written in language executed on such an interpreter. Additionally, unpredictable jump targets also occur frequently in switch statement executed in "C".